package org.elucid.gadmin.model;

import javax.swing.ImageIcon;

import org.elucid.gadmin.GTreeItem;
import org.elucid.gadmin.ServerInfo;
import org.elucid.gadmin.ui.GFrame;

public class ServerItem implements GTreeItem{

	ImageIcon icon = GFrame.createImageIcon("icons/server.png");
	private final ServerInfo serverInfo;
 

	public ServerItem(ServerInfo serverInfo) {
		this.serverInfo = serverInfo;
	}

	@Override
	public String toString() {
		return String.format("%s [%s:%s]", serverInfo.getName(), serverInfo.getIp_address(), serverInfo.getPort());
	}

	@Override
	public ImageIcon getTreeIcon() {
		return icon;
	}

	public ServerInfo getServerInfo() {
		return serverInfo;
	}
	
	
}
